Technical Q&A QA1201
SCSIAction and IOSCSIUserClient on Mac OS X 10.2


Q: My application communicates with SCSI Parallel devices like scanners or printers using the SCSIAction or IOSCSIUserClient APIs. This worked on all versions of Mac OS X prior to 10.2. On Mac OS X 10.2, when I call SCSIAction I get an opWrErr (-49). Or, if I call IOSCSIDeviceInterface->open I get a kIOReturnExclusiveAccess error (0xE00002C5 or -536870203). Why does this no longer work?

A: IOSCSIUserClient and SCSIAction are deprecated APIs in Mac OS X 10.2. The intention was for these APIs to continue functioning as on earlier releases until users installed SCSI HBA drivers written to the new IOSCSIParallelFamily that shipped in Mac OS X 10.2. These APIs were inadvertently disabled and have been restored in Mac OS X 10.2.1 (rr. 3006423, 3026125). Until then, calling open on an IOSCSIDeviceInterface will return kIOReturnExclusiveAccess. SCSIAction internally calls that same function and maps the I/O Kit error kIOReturnExclusiveAccess to the OSErr opWrErr.

SCSITaskUserClient is the API that replaces IOSCSIUserClient and SCSIAction. Apple recommends that developers wishing the greatest backward compatibility use both SCSITaskUserClient and SCSIAction/IOSCSIUserClient to discover their device, then use the API which found the device to communicate with it.


[Sep 13 2002]


Developer Documentation | Technical Notes | Development Kits | Sample Code